package com.nervenets.shopping.service;

import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.nervenets.general.service.BaseService;
import com.nervenets.shopping.hibernate.dao.vo.DayCount;
import com.nervenets.shopping.hibernate.domain.order.GroupBuyOrderUser;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface GroupBuyOrderUserService extends BaseService<GroupBuyOrderUser> {
    WxPayMpOrderResult wxJsapiPay(String body, String orderNumber, long money, String openId, String notifyUrl, HttpServletRequest request) throws WxPayException;

    long countUserState(long userId, long startTime, long endTime);

    long sumOfReward();

    long sumOfReward(long startTime, long endTime);

    long sumOfOrderMoney();

    long sumOfOrderMoney(long startTime, long endTime);

    long sumOfRefundMoney();

    long sumOfRefundMoney(long startTime, long endTime);

    List<DayCount> groupByDay(long userId, long startTime, long endTime);

    List<GroupBuyOrderUser> findTopUngroupedOrder(long timeout);
}
